package per.com.controller.studentmanage;


import com.fasterxml.jackson.databind.ser.Serializers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import per.com.bean.BaseBean;
import per.com.bean.studentmanage.StudentBean;
import per.com.service.impl.studentmanage.StudentmanageService;

@Controller
@RequestMapping("/Student")
public class StudentmanageController {
    @Autowired
    @Qualifier("StudentServiceId")
    private StudentmanageService studentmanageService;
    @RequestMapping(value = "/insertstudent",method = RequestMethod.POST)
    @ResponseBody
    public BaseBean insertstudent(StudentBean studentBean){
        studentmanageService.insertstudent(studentBean);
        return new BaseBean(0,"success",studentBean);
    }
    @RequestMapping(value = "GetStudent",method = RequestMethod.POST)
    @ResponseBody
    public BaseBean GetStudent(){
        return new BaseBean(0,"success",studentmanageService.GetStudent());
    }
    @RequestMapping(value = "/selectbyid",method = RequestMethod.POST)
    @ResponseBody
    public BaseBean selectbyid(String studentid){
        return new BaseBean(0,"success",studentmanageService.selectbyid(studentid));
    }
    @RequestMapping(value = "selectbyname",method = RequestMethod.POST)
    @ResponseBody
    public BaseBean selectbyname(String name){
        return new BaseBean(0,"success",studentmanageService.selectbyname(name));
    }


}
